/**
*@Author:zt
*@Description: 单位管理相关接口
*@Date 2024-08-14
*/
import request from '@/http'

 // 单位树形
 export const tree = async () => {
  return await request.get({
    url: '/authority/sysTUnits/tree',
  })
}

// 单位有效树形
export const validTree = async () => {
  return await request.get({
    url: '/authority/sysTUnits/validTree',
  })
}



// 新增
export const add = async (data: object) => {
  return await request.post({
    url: '/authority/sysTUnits',
    data: data
  })
}


// 修改
export const update = async (data: object) => {
  return await request.post({
    url: '/authority/sysTUnits/update',
    data: data
  })
}

// 删除
export const del = async (data: Array<any>) => {
  return await request.post({
    url: '/authority/sysTUnits/delete',
    data,
    headersType: 'application/x-www-form-urlencoded'
  })
}

 // 查询单个数据
 export const singleQuery = async (data: any) => {
  return await request.get({
    url: '/authority/sysTUnits/'+data
  })
}



